<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<include file="Public/head" />
<link href="__STATIC__/css/user.css" type="text/css" rel="stylesheet" />
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js" ></script>
</head>

<body class="body_bg">
<include file="Public/top" />

<div class="login_tit login_tit_white">
  <div class="return"><a href="{:U('User/order_list')}"><i class="icon-fanhui"></i></a></div>
  <span>订单详情</span>
</div><!--login_tit-->
<div class="page_in order_paypage">
  <div class="order_status">
    <div><i class="icon-iconfontcolor94"></i></div>
    <p>订单提交成功，请您尽快付款！</p>
  </div><!--order_status-->
  <div class="order_sul">
    <php>if($type=='recharge'){</php>
    <div class="order_sli"><div class="ll">订单号</div><div class="rr">{$order['order_sn']}</div></div>
    <div class="order_sli"><div class="ll">订单类型</div><div class="rr">充值</div></div>
    <div class="order_sli"><div class="ll">充值金额</div><div class="rr">{$order['account']}</div></div>
    <php>}else{</php>
    <div class="order_sli"><div class="ll">订单号</div><div class="rr">{$order['order_sn']}</div></div>
    <div class="order_sli"><div class="ll">店铺价钱</div><div class="rr">{$order['price']}元</div></div>
    <div class="order_sli"><div class="ll">保 证 金</div><div class="rr">{$order['b_price']}元</div></div>
    <div class="order_sli"><div class="ll">技术年费</div><div class="rr">{$order['j_price']}元</div></div>
    <div class="order_sli"><div class="ll">手 续 费</div><div class="rr">{$order['s_price']}元 <span style="color:red"><if condition="$goods_type eq 3">(店铺价格的10%)<else />(店铺总价的10%)</if></span></div></div>
    <div class="order_sli"><div class="ll">总价</div><div class="rr">{$order['total_amount']}元</div></div>
    <div class="order_sli"><div class="ll">当前应付款</div><div class="rr">{$order['pay_price']}元 <span style="color:red;">(支付定金后保留7天)</span></div></div>
    <div class="order_stip">请您在预留期内支付定金，如果发现店铺与我们网站描述的不符，7天内可以申请退款，超过7天或者非我方过错导致交易无法往下进行的，均无法退回本次支付的定金，请知悉！</div>
    <php>}</php>
  </div><!--order_sul-->
 <!--
  <div class="order_pay">
    <div class="order_paytit">支付方式</div>
    <form action="{:U('Home/Payment/getCode')}" method="post" name="cart4_form" id="cart4_form">
      <foreach name="paymentList" item="v" key="k">
      <div class="order_payli" onClick="change_pay(this);">
        <span class="hide"><input type="radio" id="input-ALIPAY-1" value="pay_code={$v['code']}" class="radio vam" name="pay_radio" ></span>
        <span class="open"><i class="icon-iconfontcolor94"></i></span>
        <span class="img"><img src="__STATIC__/images/payico_{$v['code']}.png" /></span>
        <span class="name">{$v[name]}</span>
      </div>&lt;!&ndash;order_payli&ndash;&gt;
      </foreach>
      <div class="order_paya"><div class="ginfo_buy"><a class="order_paya" href="javascript:void(0);" onClick="$('#cart4_form').submit();" >确认支付方式</a></div></div>
      <input type="hidden" name="order_id" value="{$order['order_id']}" />
    </form>
  </div>&lt;!&ndash;order_pay&ndash;&gt;
  -->
  <div id="wx_mini_btn" style="display:none"> <!--微信小程序端-->
    <div class="order_paya">
      <div class="ginfo_buy">
        <a href="javascript:;" onclick="wx_mini_pay({$order.order_id});">立即支付</a>
      </div>
    </div>
  </div>
  <div id="wx_btn" style="display:none"><!--微信浏览器-->
    <div class="order_paya">
      <div class="ginfo_buy">
        <a href="{:U('Home/Payment/getCode',array('pay_radio'=>'pay_code=weixin','order_id'=>$order[order_id]))}">立即支付</a>
      </div>
    </div>
  </div>
  <div id="mobile_btn" style="display:none"><!--手机端-->
    <!--<div class="order_paya"><div class="ginfo_buy"><a   class="order_paya" href="javascript:alert('loading...');">立即支付</a></div></div>-->
    <div class="order_paya"><div class="ginfo_buy"><a id="get_pay" class="order_paya" href="javascript:;">立即支付</a></div></div>
  </div>

</div><!--order_page-->
<script>
$(document).ready(function(){

	if(mobtype=="miniprogram")
	{
		$('#wx_mini_btn').show();
		$('#wx_btn').hide();
		$('#mobile_btn').hide();
    }
	else if(mobtype=="wechat")
	{
		$('#wx_mini_btn').hide();
		$('#wx_btn').show();
		$('#mobile_btn').hide();
    }
	else if(mobtype=="web")
	{
        $('#wx_mini_btn').hide();
        $('#wx_btn').hide();
        $('#mobile_btn').show();
        get_h5_pay("{$order.order_id}");//调取微信H5支付

//		$('#wx_mini_btn').hide();
//		$('#wx_btn').hide();
//		$('#mobile_btn').show();
    }


	$('input[name="pay_radio"]').first().prop("checked",true);
	$(".order_payli").first().addClass('order_payli_on');
});


function wx_mini_pay(order_id){
    var path = '../wxPay/wxPay?order_id=' + order_id;
    //通过JSSDK的api使小程序跳转到指定的小程序页面
    wx .miniProgram.navigateTo({url: path});

}

function get_h5_pay(order_id){
    var pay_radio =  'pay_code=weixin';
    if(pay_radio=='pay_code=weixin'){
        $.ajax({
            type : "POST",
            url:"{:U('Mobile/Payment/getH5Code')}",//+tab,
//            data : $('#cart4_form').serialize(),// 你的formid
            data :{pay_radio:pay_radio,order_id:order_id},// 你的formid
            success: function(data){
                //将返回值赋值给href跳转支付
                if(data){
                    $("#get_pay").attr("href",data);
                }
            }
        });
    }
}

// 切换支付方式
function change_pay(obj)
{
	$(obj).addClass("order_payli_on").siblings().removeClass('order_payli_on');
	$(obj).find('input[name="pay_radio"]').prop("checked",true).parents('.order_payli_on').siblings().find('input[name="pay_radio"]').prop("checked",false);
}
</script>

<include file="Public/footer" />
</body>
</html>